<template>
<div class='container'>
    <div class='mycard'>
      <div class='weui-cell'>
        <div class='weui-cell__hd'>
          <div class='tx'>
            <avatar :avatar="userINfo.avatar" :Level="userINfo.partner_level" :userId="userINfo.id" :isAuth="userINfo.is_auth" :isPartner="userINfo.is_partner"></avatar>
          </div>
        </div>
        <div class='weui-cell__bd'>
          <div class='myList'>
            <div class='myListItem'>
              <div class='shu'>
                <span v-if="userINfo.fans==null">0</span>
                <span v-else>{{userINfo.fans}}</span>
              </div>
              <div class='zi'>粉丝</div>
            </div>
            <div class='myListItem'>
              <div class='shu'>
                <span v-if="userINfo.guanzhu==null">0</span>
                <span v-else>{{userINfo.guanzhu}}</span>
              </div>
              <div class='zi'>关注</div>
            </div>
            <div class='myListItem'>
              <div class='shu'>
                <span v-if="userINfo.zan==null">0</span>
                <span v-else>{{userINfo.zan}}</span>
              </div>
              <div class='zi'>获赞</div>
            </div>
            <div class='myListItem'>
              <div class='shu'>
                <span v-if="userINfo.jifen==null">0</span>
                <span v-else>{{userINfo.jifen}}</span>
              </div>
              <div class='zi'>积分</div>
            </div>
          </div>
          <div class='userName'>
            <div class="weui-cell__bd"></div>
            <div class='weui-cell__ft'>
              <chatBtn :userInfo="userINfo"/>
            </div>
            <div class='weui-cell__ft'>
              <Follow :info="userINfo" :userId="userINfo.id"></Follow>
            </div>
          </div>
        </div>
      </div>
      <div class='weui-cell'>
        <div class='weui-cell__bd'>
          <div class='userINfo'>
            <img src='/static/images/renz.png' style='width:12px;height:11px;margin-right:10px;' /> 认证：
            <span v-if="userINfo.is_auth==2">认证失败</span>
            <span v-if="userINfo.is_auth==1">审核中</span>
            <span v-if="userINfo.is_auth==0">未认证</span>
            <span v-if="userINfo.role==1&&userINfo.is_auth==3">家长</span>
            <span v-if="userINfo.role==2&&userINfo.is_auth==3">优秀老师</span>
            <span v-if="userINfo.role==3&&userINfo.is_auth==3">教育公司</span>
            <span v-if="userINfo.role==4&&userINfo.is_auth==3">教育媒体</span>
            <span v-if="userINfo.role==5&&userINfo.is_auth==3">其他</span>
            <span v-if="userINfo.role==6&&userINfo.is_auth==3">全日制学校</span>
          </div>
          <div class='userINfo'>
            <img src='/static/images/myadr.png' style='width:12px;height:12px;margin-right:10px;' />
            <span v-if="!userINfo.area">位置：该用户暂未填写地址</span>
            <span v-else>位置：{{userINfo.area}}</span>
          </div>
          <div class='userINfo'>
            <img src='/static/images/info.png' style='width:12px;height:12px;margin-right:10px;' />
            <span v-if="!userINfo.brief">简介：该用户暂未填写简介</span>
            <span v-else>简介：{{userINfo.brief}}</span>
          </div>
          <!-- <div class='userINfo'>
            <img src='/static/images/info.png' style='width:12px;height:12px;margin-right:10px;' />
            <span v-if="!userINfo.brief">年龄：该用户暂未填写年龄</span>
            <span v-else>年龄：{{userINfo.brief}}</span>
          </div> -->
          <div class='userINfo'>
            <img src='/static/images/ic_grade@2x.png' style='width:15px;height:12px;margin-right:10px;' />
            <span v-if="!userINfo.class">年级：该用户暂未填写年级</span>
            <span v-else>年级：{{userINfo.class}}</span>
          </div>
          <!-- <div class='userINfo'>
            <img src='/static/images/info.png' style='width:12px;height:12px;margin-right:10px;' />
            <span v-if="!userINfo.brief">性别：该用户暂未填写性别</span>
            <span v-else>性别：{{userINfo.brief}}</span>
          </div> -->
          <!-- <div class='userINfo'>
            <img src='/static/images/info.png' style='width:12px;height:12px;margin-right:10px;' />
            <span v-if="!userINfo.brief">兴趣：该用户暂未填写兴趣</span>
            <span v-else>兴趣：{{userINfo.brief}}</span>
          </div> -->
        </div>
      </div>
    </div>
    <div class="line"></div>
    <classTit title="个人介绍"></classTit>
    <div style="width:360px;margin:0 auto">
        <wxParse :content="article" v-if="article"/>
    </div>
     <img :src="img+'/que/no_conten@2x.png'" class="queS" v-if="queS"/>
</div>
</template>

<style lang="scss">
@import url("~mpvue-wxparse/src/wxParse.css");
.allNav {
    .van-tab {
        font-size: 14px;
        color: #666;
    }

    .van-tab--active {
        color: #333;
        font-size: 15px;
    }

    .van-tabs__line {
        background-color: #1A84FB;
    }

    .classify .nav .nav-item s {
        width: 25%;
    }

    .special {
        border: none;
    }

    .videolist {
        border: none;

        .content {
            padding-top: 10px;
        }
    }

    .queList {
        border: none;

        .report {
            float: right;
            margin-top: 8px;
        }
    }

    // .queList{

    // }
}
</style>

<script>
import wxParse from 'mpvue-wxparse'
import Follow from "@/components/follow"
import special from "@/components/special"
import videoList from "@/components/videoList"
import questionlist from "@/components/questionlist"
import classTit from "@/components/classTit"
import avatar from "@/components/avatar"
import chatBtn from "@/components/chatBtn"
import {
    otherINfo
} from "@/api/other"
import {
    info
} from "@/api/other"
export default {
    components: {
        chatBtn,
        avatar,
        Follow,
        special,
        videoList,
        questionlist,
        classTit,
        wxParse,
    },

    data() {
        return {
          article:'',
          img: this.$URL.imgurl,
          queS:false,
          userINfo:"",
          user_id:0
        }
    },
    onLoad(options) {
        // console.log(options)
        this.user_id = wx.getStorageSync("user_info").id;
        this.ta_uid = options.id
        this.getinfo()
    },
    methods: {
        getinfo() {
          Object.assign(this.$data, this.$options.data())
            info({
                ta_uid: this.ta_uid
            }).then(res => {
              if(res.code==200){
                    
                if(res.data.content){
                     this.article=res.data.content     
                }else{
                   this.queS=true   
                }
              }else if(res.code==201){
                this.queS=false   
              }
            })
            otherINfo({ta_uid: this.ta_uid,user_id:this.user_id}).then(res=>{
                 this.userINfo=res.data
            })
        },
    },
}
</script>
<style lang="scss" >
.mycard{
  .share{
    text-align: center;
    font-size:11px;
    font-weight:500;
    color:rgba(26,132,251,1);
    line-height:18px;
  }
  .tx{
    width:84px;
    height:84px;
    border-radius:50%;
    position: relative;
    .Avatar{
        width:84px;
        height:84px;
        .avatar{
            display: block;
            width:84px;
            height:84px;
            border-radius:50%;
            border:1px solid rgba(26,132,251,1);
        }
        .grade{
            width:46rpx;
            height:46rpx;
        }
    }
  }
  .myList{
    display: flex;
  }
  .myListItem{
    -webkit-box-flex:1;
    -webkit-flex:1;
    flex:1;
    text-align: center;
    line-height: 1;
    .shu{
      font-size:17px;
      font-weight:bold;
      color:rgba(51,51,51,1);
    }
    .zi{
      font-size:12px;
      font-weight:500;
      color:rgba(102,102,102,1);
      margin-top: 7px;
    }
  }
  .userName{
    display: flex;
    padding-left: 20px;
    margin-top: 13px;
    .btn{
        width:71px;
        border:1px solid rgba(102,102,102,1);
        border-radius:5px;
        text-align: center;
        line-height: 27px;
        font-size:14px;
        font-weight:500;
        color:rgba(51,51,51,1);
        margin-right: 20px;
    }
  }
  .userINfo{
    font-size:12px;
    font-weight:500;
    color:rgba(102,102,102,1);
    line-height: 1;
    margin-bottom: 10px;
    display:-webkit-box;
    display:-webkit-flex;
    display:flex;
    -webkit-box-align:center;
    -webkit-align-items:center;
    align-items:center;
  }
}  
.whiteLIne{
  height:10px;
}
.mycard{
  .share{
    text-align: center;
    font-size:11px;
    font-weight:500;
    color:rgba(26,132,251,1);
    line-height:18px;
  }
  .tx{
    width:84px;
    height:84px;
    border-radius:50%;
    position: relative;
     .avatar{
      display: block;
      width:84px;
      height:84px;
      border-radius:50%;
      border:1px solid rgba(26,132,251,1);
    }
    .grade{
      width:19px;
      height:19px;
      position: absolute;
      border-bottom: 6px;
      right: 6px;
      bottom:0;
    }
  }
  .myList{
    display: flex;
  }
  .myListItem{
    -webkit-box-flex:1;
    -webkit-flex:1;
    flex:1;
    text-align: center;
    line-height: 1;
    .shu{
      font-size:17px;
      font-weight:bold;
      color:rgba(51,51,51,1);
    }
    .zi{
      font-size:12px;
      font-weight:500;
      color:rgba(102,102,102,1);
      margin-top: 7px;
    }
  }
  .userName{
    display: flex;
    padding-left: 20px;
    margin-top: 13px;
    .btn{
        width:71px;
        border:1px solid rgba(102,102,102,1);
        border-radius:5px;
        text-align: center;
        line-height: 27px;
        font-size:14px;
        font-weight:500;
        color:rgba(51,51,51,1);
        margin-right: 20px;
    }
  }
  .userINfo{
    font-size:12px;
    font-weight:500;
    color:rgba(102,102,102,1);
    line-height: 1;
    margin-bottom: 10px;
    display:-webkit-box;
    display:-webkit-flex;
    display:flex;
    -webkit-box-align:center;
    -webkit-align-items:center;
    align-items:center;
  }
}    
li{
  position: relative;
  &::after{
     position: absolute;
     left:15px;
     right:15px;
     content:"";
     bottom:0;
     border-bottom:1px solid #ddd;
  }
}
.kong{
   height: 49px;
}
.footer{
    width:375px;
    height:49px;
    background:rgba(255,255,255,1);
    box-shadow:0px 0px 0px 0px rgba(221,221,221,1);
    text-align: center;
    line-height: 49px;
    font-size:14px;
    font-weight:500;
    color:rgba(51,51,51,1);
    position: fixed;
    bottom: 0;
    left: 0;
    display: flex;
    border-top: 1px solid #ddd;
    img{
        vertical-align: middle;
    }
}
</style>
